{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GIF Animation Generator using LangGraph and DALL-E\n",
    "\n",
    "## Overview\n",
    "This project demonstrates the creation of a GIF animation generator that leverages the power of large language models (LLMs) and image generation AI. By combining LangGraph for workflow management, GPT-4 for text generation, and DALL-E for image creation, we've developed a system that can produce custom GIF animations based on user prompts.\n",
    "\n",
    "## Motivation\n",
    "In the era of AI-driven content creation, there's a growing demand for tools that can automate and simplify complex creative processes. This project aims to showcase how various AI technologies can be integrated to create a seamless workflow that transforms a simple text prompt into a dynamic visual story. By doing so, we're exploring the potential of AI in creative fields and providing a tool that could be valuable for content creators, educators, and enthusiasts alike.\n",
    "\n",
    "## Key Components\n",
    "1. **LangGraph**: Orchestrates the overall workflow, managing the flow of data between different stages of the process.\n",
    "2. **GPT-4 (via LangChain)**: Generates detailed descriptions, plots, and image prompts based on the initial user query.\n",
    "3. **DALL-E 3**: Creates high-quality images based on the generated prompts.\n",
    "4. **Python Imaging Library (PIL)**: Assembles the individual images into a GIF animation.\n",
    "5. **Asynchronous Programming**: Utilizes `asyncio` and `aiohttp` for efficient parallel processing of image generation and retrieval.\n",
    "\n",
    "## Method\n",
    "The GIF generation process follows these high-level steps:\n",
    "\n",
    "1. **Character/Scene Description**: Based on the user's input query, the system generates a detailed description of the main character or scene.\n",
    "\n",
    "2. **Plot Generation**: Using the character description and initial query, a 5-step plot is created, outlining the progression of the animation.\n",
    "\n",
    "3. **Image Prompt Creation**: For each step of the plot, a specific image prompt is generated, ensuring consistency across the frames.\n",
    "\n",
    "4. **Image Generation**: DALL-E 3 is used to create images based on each prompt.\n",
    "\n",
    "5. **GIF Assembly**: The generated images are compiled into a GIF animation.\n",
    "\n",
    "Throughout this process, LangGraph manages the flow of information between steps, ensuring that the output of each stage is appropriately fed into the next. The use of asynchronous programming allows for efficient parallel processing, particularly during the image generation and retrieval phases.\n",
    "\n",
    "## Conclusion\n",
    "This GIF Animation Generator demonstrates the potential of combining different AI technologies to create a powerful, user-friendly tool for content creation. By automating the process from text prompt to visual animation, it opens up new possibilities for storytelling, education, and entertainment. \n",
    "\n",
    "The modular nature of the system, facilitated by LangGraph, allows for easy updates or replacements of individual components. This makes the project adaptable to future advancements in language models or image generation technologies.\n",
    "\n",
    "While the current implementation focuses on creating simple 5-frame GIFs, the concept could be extended to create longer animations, incorporate user feedback at intermediate stages, or even integrate with other media types. As AI continues to evolve, tools like this will play an increasingly important role in bridging the gap between human creativity and machine capabilities."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Setup and Imports\n",
    "\n",
    "Import necessary libraries and set up the environment."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "from typing import TypedDict, Annotated, Sequence, List\n",
    "from langgraph.graph import Graph, END\n",
    "from langchain_openai import ChatOpenAI\n",
    "from langchain_core.messages import HumanMessage, AIMessage\n",
    "from openai import OpenAI\n",
    "from PIL import Image\n",
    "import io\n",
    "from IPython.display import display, Image as IPImage\n",
    "\n",
    "from langchain_core.runnables.graph import MermaidDrawMethod\n",
    "\n",
    "import asyncio\n",
    "import aiohttp\n",
    "from dotenv import load_dotenv\n",
    "\n",
    "# Load environment variables\n",
    "load_dotenv()\n",
    "\n",
    "# Set OpenAI API key\n",
    "os.environ[\"OPENAI_API_KEY\"] = os.getenv('OPENAI_API_KEY')\n",
    "\n",
    "# Initialize OpenAI client\n",
    "client = OpenAI()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Define Data Structures\n",
    "\n",
    "Define the structure for the graph state using TypedDict."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "class GraphState(TypedDict):\n",
    "    messages: Annotated[Sequence[HumanMessage | AIMessage], \"The messages in the conversation\"]\n",
    "    query: Annotated[str, \"Input query describing the character and scene\"]\n",
    "    plot: Annotated[str, \"Generated plot for the GIF\"]\n",
    "    character_description: Annotated[str, \"Detailed description of the main character or object\"]\n",
    "    image_prompts: Annotated[List[str], \"List of prompts for each frame\"]\n",
    "    image_urls: Annotated[List[str], \"List of URLs for generated images\"]\n",
    "    gif_data: Annotated[bytes, \"GIF data in bytes\"]\n",
    "\n",
    "# Initialize the language model\n",
    "llm = ChatOpenAI(model=\"gpt-4\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Define Graph Functions\n",
    "\n",
    "Define the functions that will be used in the LangGraph workflow."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "async def get_image_data(session, url: str):\n",
    "    \"\"\"Fetch image data from a given URL.\"\"\"\n",
    "    async with session.get(url) as response:\n",
    "        if response.status == 200:\n",
    "            return await response.read()\n",
    "    return None\n",
    "\n",
    "def generate_character_description(state: GraphState) -> GraphState:\n",
    "    \"\"\"Generate a detailed description of the main character or scene.\"\"\"\n",
    "    query = state[\"query\"]\n",
    "    response = llm.invoke([HumanMessage(content=f\"Based on the query '{query}', create a detailed description of the main character, object, or scene. Include specific details about appearance, characteristics, and any unique features. This description will be used to maintain consistency across multiple images.\")])\n",
    "    state[\"character_description\"] = response.content\n",
    "    return state\n",
    "\n",
    "def generate_plot(state: GraphState) -> GraphState:\n",
    "    \"\"\"Generate a 5-step plot for the GIF animation.\"\"\"\n",
    "    query = state[\"query\"]\n",
    "    character_description = state[\"character_description\"]\n",
    "    response = llm.invoke([HumanMessage(content=f\"Create a short, 5-step plot for a GIF based on this query: '{query}' and featuring this description: {character_description}. Each step should be a brief description of a single frame, maintaining consistency throughout. Keep it family-friendly and avoid any sensitive themes.\")])\n",
    "    state[\"plot\"] = response.content\n",
    "    return state\n",
    "\n",
    "def generate_image_prompts(state: GraphState) -> GraphState:\n",
    "    \"\"\"Generate specific image prompts for each frame of the GIF.\"\"\"\n",
    "    plot = state[\"plot\"]\n",
    "    character_description = state[\"character_description\"]\n",
    "    response = llm.invoke([HumanMessage(content=f\"\"\"Based on this plot: '{plot}' and featuring this description: {character_description}, generate 5 specific, family-friendly image prompts, one for each step. Each prompt should be detailed enough for image generation, maintaining consistency, and suitable for DALL-E. \n",
    "\n",
    "Always include the following in EVERY prompt to maintain consistency:\n",
    "1. A brief reminder of the main character or object's key features\n",
    "2. The specific action or scene described in the plot step\n",
    "3. Any relevant background or environmental details\n",
    "\n",
    "Format each prompt as a numbered list item, like this:\n",
    "1. [Your prompt here]\n",
    "2. [Your prompt here]\n",
    "... and so on.\"\"\")])\n",
    "    \n",
    "    prompts = []\n",
    "    for line in response.content.split('\\n'):\n",
    "        if line.strip().startswith(('1.', '2.', '3.', '4.', '5.')):\n",
    "            prompt = line.split('.', 1)[1].strip()\n",
    "            prompts.append(f\"Create a detailed, photorealistic image of the following scene: {prompt}\")\n",
    "    \n",
    "    if len(prompts) != 5:\n",
    "        raise ValueError(f\"Expected 5 prompts, but got {len(prompts)}. Please try again.\")\n",
    "    \n",
    "    state[\"image_prompts\"] = prompts\n",
    "    return state\n",
    "\n",
    "async def create_image(prompt: str, retries: int = 3):\n",
    "    \"\"\"Generate an image using DALL-E based on the given prompt.\"\"\"\n",
    "    for attempt in range(retries):\n",
    "        try:\n",
    "            response = await asyncio.to_thread(\n",
    "                client.images.generate,\n",
    "                model=\"dall-e-3\",\n",
    "                prompt=prompt,\n",
    "                size=\"1024x1024\",\n",
    "                quality=\"standard\",\n",
    "                n=1,\n",
    "            )\n",
    "            return response.data[0].url\n",
    "        except Exception as e:\n",
    "            if attempt == retries - 1:\n",
    "                print(f\"Failed to generate image for prompt: {prompt}\")\n",
    "                print(f\"Error: {str(e)}\")\n",
    "                return None\n",
    "            await asyncio.sleep(2)  # Wait before retrying\n",
    "\n",
    "async def create_images(state: GraphState) -> GraphState:\n",
    "    \"\"\"Generate images for all prompts in parallel.\"\"\"\n",
    "    image_prompts = state[\"image_prompts\"]\n",
    "    tasks = [create_image(prompt) for prompt in image_prompts]\n",
    "    image_urls = await asyncio.gather(*tasks)\n",
    "    state[\"image_urls\"] = image_urls\n",
    "    return state\n",
    "\n",
    "async def create_gif(state: GraphState) -> GraphState:\n",
    "    \"\"\"Create a GIF from the generated images.\"\"\"\n",
    "    image_urls = state[\"image_urls\"]\n",
    "    images = []\n",
    "    async with aiohttp.ClientSession() as session:\n",
    "        tasks = [get_image_data(session, url) for url in image_urls if url]\n",
    "        image_data_list = await asyncio.gather(*tasks)\n",
    "    \n",
    "    for img_data in image_data_list:\n",
    "        if img_data:\n",
    "            images.append(Image.open(io.BytesIO(img_data)))\n",
    "    \n",
    "    if images:\n",
    "        gif_buffer = io.BytesIO()\n",
    "        images[0].save(gif_buffer, format='GIF', save_all=True, append_images=images[1:], duration=1000, loop=0)\n",
    "        state[\"gif_data\"] = gif_buffer.getvalue()\n",
    "    else:\n",
    "        state[\"gif_data\"] = None\n",
    "    return state"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Set Up LangGraph Workflow\n",
    "\n",
    "Define the LangGraph workflow by adding nodes and edges."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "workflow = Graph()\n",
    "\n",
    "workflow.add_node(\"generate_character_description\", generate_character_description)\n",
    "workflow.add_node(\"generate_plot\", generate_plot)\n",
    "workflow.add_node(\"generate_image_prompts\", generate_image_prompts)\n",
    "workflow.add_node(\"create_images\", create_images)\n",
    "workflow.add_node(\"create_gif\", create_gif)\n",
    "\n",
    "workflow.add_edge(\"generate_character_description\", \"generate_plot\")\n",
    "workflow.add_edge(\"generate_plot\", \"generate_image_prompts\")\n",
    "workflow.add_edge(\"generate_image_prompts\", \"create_images\")\n",
    "workflow.add_edge(\"create_images\", \"create_gif\")\n",
    "workflow.add_edge(\"create_gif\", END)\n",
    "\n",
    "workflow.set_entry_point(\"generate_character_description\")\n",
    "\n",
    "app = workflow.compile()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Display Graph Structure"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADb/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAJ2ARQDASIAAhEBAxEB/8QAHQABAAMBAQEBAQEAAAAAAAAAAAUGBwQIAwIBCf/EAFoQAAEDBAACBQYHCQsKAwkBAAEAAgMEBQYRBxITFSExlAgXIkFW0xQWMlFUVdI2N2F0dZOz0dQjJjNEcYGRlbK0wy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JDwfwaIHzn1/e9E/iGD0vDyY0xFXbE9vzgmL64ZBWcErddOH94xG5X/ACC60l1lZLPW19a2aqBa5jgGuczlaP3NvZy/P6+1Tty4e2u7ZrR5NUunkrKagltwpyWmB8Uh27maW7J9Xfr8Ctht12Hfj18/qyf7KdX3b2evn9Vz/YXoxTgRu7O3ds+qZZ3Mdtvky47aa20SU98yT4DaLjHcqG1SXASUkEjHFwa1jmH0dk+vm7T2jZ3rj3tjaXOIa0DZJOgAuynsN/rXhlPjd3ke7uElKYB//UnKB/OVf8M4OzvqIq7JhCY2EPZa4j0jSfUZXdztf7A7PnLh2Lmr6R0ToVEzEx4Rt/fotp7U1wVx2W1Y5UXKpjdFUXWXp2sf3shDQ2MH+UAv/wCPXqWhIi+Cx8arpGLVi1bZWRERc6CIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiIP/2Q==",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(\n",
    "    IPImage(\n",
    "        app.get_graph().draw_mermaid_png(\n",
    "            draw_method=MermaidDrawMethod.API,\n",
    "        )\n",
    "    )\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Run Workflow Function\n",
    "\n",
    "Define a function to run the workflow and display results."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "async def run_workflow(query: str):\n",
    "    \"\"\"Run the LangGraph workflow and display results.\"\"\"\n",
    "    initial_state = {\n",
    "        \"messages\": [],\n",
    "        \"query\": query,\n",
    "        \"plot\": \"\",\n",
    "        \"character_description\": \"\",\n",
    "        \"image_prompts\": [],\n",
    "        \"image_urls\": [],\n",
    "        \"gif_data\": None\n",
    "    }\n",
    "\n",
    "    try:\n",
    "        result = await app.ainvoke(initial_state)\n",
    "\n",
    "        print(\"Character/Scene Description:\")\n",
    "        print(result[\"character_description\"])\n",
    "\n",
    "        print(\"\\nGenerated Plot:\")\n",
    "        print(result[\"plot\"])\n",
    "\n",
    "        print(\"\\nImage Prompts:\")\n",
    "        for i, prompt in enumerate(result[\"image_prompts\"], 1):\n",
    "            print(f\"{i}. {prompt}\")\n",
    "\n",
    "        print(\"\\nGenerated Image URLs:\")\n",
    "        for i, url in enumerate(result[\"image_urls\"], 1):\n",
    "            print(f\"{i}. {url}\")\n",
    "\n",
    "        if result[\"gif_data\"]:\n",
    "            print(\"\\nGIF generated successfully. Use the next cell to display or save it.\")\n",
    "        else:\n",
    "            print(\"\\nFailed to generate GIF.\")\n",
    "        \n",
    "        return result\n",
    "    except Exception as e:\n",
    "        print(f\"An error occurred: {str(e)}\")\n",
    "        return None"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Execute Workflow\n",
    "\n",
    "Run the workflow with a sample query."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "query = \"A cat wearing a top hat and monocle, sitting at a desk and writing a letter with a quill pen.\"\n",
    "result = await run_workflow(query)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Display and Save GIF\n",
    "\n",
    "Display the generated GIF and provide an option to save it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "if result and result[\"gif_data\"]:\n",
    "    # Display the GIF\n",
    "    display(IPImage(data=result[\"gif_data\"], format='gif'))\n",
    "    \n",
    "    # Ask if the user wants to save the GIF\n",
    "    save_gif = input(\"Do you want to save the GIF? (yes/no): \").lower().strip()\n",
    "    if save_gif == 'yes':\n",
    "        filename = input(\"Enter the filename to save the GIF (e.g., output.gif): \").strip()\n",
    "        if not filename.endswith('.gif'):\n",
    "            filename += '.gif'\n",
    "        with open(filename, 'wb') as f:\n",
    "            f.write(result[\"gif_data\"])\n",
    "        print(f\"GIF saved as {filename}\")\n",
    "    else:\n",
    "        print(\"GIF not saved.\")\n",
    "else:\n",
    "    print(\"No GIF data available to display or save.\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![Cat_GIF_agent](../images/langgraph_agent_cat_animation.gif)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
